package com.example.covid19.mapper;

import com.example.covid19.entity.OrderForm;
import com.example.covid19.entity.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.covid19.entity.Orderdto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author BaiZhengChun
 * @since 2022-09-12
 */
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
    @Select("SELECT " +
            " order_form.*,  " +
            " order_info.pic,  " +
            " order_info.price,  " +
            " order_info.quantity,  " +
            " order_info.goodsid,  " +
            " order_info.sid " +
            "FROM " +
            " order_form " +
            " INNER JOIN " +
            " order_info " +
            " ON  " +
            " order_form.ordernumber = order_info.ordernumber")
    List<Orderdto> Oinf();

    @Select("SELECT " +
            " *,  " +
            " order_form.* " +
            "FROM " +
            " order_form " +
            "LIMIT #{pageNo}, #{pagesize}")
    List<OrderForm> getps(@Param("pageNo")Integer pageNo,@Param("pagesize")Integer pagesize);
    @Select("SELECT " +
            " order_info.* " +
            "FROM " +
            " order_info " +
            "WHERE " +
            " order_info.ordernumber = #{ordernumber}")
    List<OrderInfo> getof(@Param("ordernumber")String ordernumber);

}
